package base.day18.exception;

public class Student {
    private int age;

    public Student() {
    }

    public Student(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age>18&&age<25){
            this.age = age;
        }
        else {
            throw new RuntimeException("请输入18-25中的数");
        }

    }
}
